#include <bits/stdc++.h>
using namespace std;
const int N = 4;
int yi[N] = {8, 4, 2, 6};
int jia[N] = {7, 5, 3, 1};

int main() {
  int s = 0;
  do {
    for (int i = 0; i < N; i++) {
      cout << jia[i] << " ";
    }
    cout << endl;
    int score = 0;
    for (int i = 0; i < N; i++) {
      if (jia[i] > yi[i])
        score++;
    }
    if (score >= 2)
      s++;
  } while (prev_permutation(jia, jia + N));

  long long zong = 1;
  for (int i = 1; i <= N; i++) {
    zong *= i;
  }

  cout << fixed << setprecision(9) << s * 1.0 / zong;
  return 0;
}